package com.kc.business.service.impl;

import com.kc.business.domain.BizArtOrder;
import com.kc.business.mapper.BizArtOrderMapper;
import com.kc.business.service.IBizArtOrderService;
import com.kc.common.constant.BizConstants;
import org.springframework.stereotype.Service;

import javax.annotation.Resource;
import java.util.List;

/**
 * TODO
 *
 * @author zhangshuo
 * @version 1.0
 * @date 2020/10/6
 */
@Service
public class BizArtOrderServiceImpl implements IBizArtOrderService {
    @Resource
    BizArtOrderMapper orderMapper;

    /**
     * 艺创订单列表
     *
     * @param artOrder
     * @return
     */
    @Override
    public List<BizArtOrder> getList(BizArtOrder artOrder) {
        return orderMapper.select(artOrder);
    }

    /**
     * 修改艺创订单
     *
     * @param artOrder
     * @return
     */
    @Override
    public int edit(BizArtOrder artOrder) {
        if (BizConstants.PASS_VERIFY.equals(artOrder.getStatus())) {
            artOrder.setProcameraCommission(artOrder.getProcameraCommission());
        }
        return orderMapper.updateByPrimaryKeySelective(artOrder);
    }
}
